home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
util
/
cli
/
WinSize.lha
/
WinSize.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-14
|
847b
|
40 lines
/* This program shows the size of the current window */
#include <stdio.h>
#include "proto/exec.h"
#include "intuition/intuitionbase.h"
struct IntuitionBase *IntBase;
void main(int argc, char *argv[])
{
struct Window *Win;
if (IntBase = (struct IntuitionBase *) OpenLibrary("intuition.library",0))
{
Win = IntBase->ActiveWindow;
if (argc > 1)
{
if ((*argv[1] == '-'))
{
switch (argv[1][1])
{
case 'c':
case 'C':
{
printf ("%d/%d/%d/%d/",Win->LeftEdge,Win->TopEdge,Win->Width,Win->Height);
break;
}
default:
{
printf("Usage: WinSize [-c] , where -c means CON: type output\n");
}
}
}
}
else
printf ("Window Position: %d x %d , Size: %d x %d\n",Win->LeftEdge,Win->TopEdge,Win->Width,Win->Height);
CloseLibrary((struct Library *) IntBase);
}
}